package cn.yuanqiao.archive.storeRoom.service.impl;

import cn.yuanqiao.archive.appManager.domain.DataScopeBase;
import cn.yuanqiao.archive.storeRoom.domain.UpDownLogs;
import cn.yuanqiao.archive.storeRoom.mapper.UpDownLogsMapper;
import cn.yuanqiao.archive.storeRoom.service.IUpDownLogsService;
import cn.yuanqiao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 上下架日志Service业务层处理
 * 
 * @author xy
 * @date 2023-06-30
 */
@Service
public class UpDownLogsServiceImpl implements IUpDownLogsService
{
    @Autowired
    private UpDownLogsMapper upDownLogsMapper;

    /**
     * 查询上下架日志
     * 
     * @param id 上下架日志主键
     * @return 上下架日志
     */
    @Override
    public UpDownLogs selectUpDownLogsById(Long id)
    {
        return upDownLogsMapper.selectUpDownLogsById(id);
    }

    /**
     * 查询上下架日志列表
     * 
     * @param upDownLogs 上下架日志
     * @return 上下架日志
     */
    @Override
    public List<UpDownLogs> selectUpDownLogsList(UpDownLogs upDownLogs)
    {
        return upDownLogsMapper.selectUpDownLogsList(new DataScopeBase() ,upDownLogs);
    }

    /**
     * 新增上下架日志
     * 
     * @param upDownLogs 上下架日志
     * @return 结果
     */
    @Override
    public int insertUpDownLogs(UpDownLogs upDownLogs)
    {
        upDownLogs.setCreateTime(DateUtils.getNowDate());
        return upDownLogsMapper.insertUpDownLogs(upDownLogs);
    }

    /**
     * 修改上下架日志
     * 
     * @param upDownLogs 上下架日志
     * @return 结果
     */
    @Override
    public int updateUpDownLogs(UpDownLogs upDownLogs)
    {
        return upDownLogsMapper.updateUpDownLogs(upDownLogs);
    }

    /**
     * 批量删除上下架日志
     * 
     * @param ids 需要删除的上下架日志主键
     * @return 结果
     */
    @Override
    public int deleteUpDownLogsByIds(Long[] ids)
    {
        return upDownLogsMapper.deleteUpDownLogsByIds(ids);
    }

    /**
     * 删除上下架日志信息
     * 
     * @param id 上下架日志主键
     * @return 结果
     */
    @Override
    public int deleteUpDownLogsById(Long id)
    {
        return upDownLogsMapper.deleteUpDownLogsById(id);
    }
}
